home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
c80tcog.lbr
/
NORMCR.CQ
/
normcr.c
Wrap
Text File
|
1985-08-09
|
2KB
|
66 lines
/* normcr - normalize a cryptogram to standard alphabet */
/* 1982/10/24 17:07
Copyright 1982 William G. Hutchison, Jr.
P.O. Box 278
Exton, PA 19341-0278
U.S.A.
CompuServe 70665,1307
This program may be used freely for any non-commercial
purpose, provided that the user does not remove or alter
this notice or the copyright statement.
Those who wish to sell or lease this program, or to
incorporate it into a product for sale or lease, should
apply to the author (above) for licensing information.
This program is not covered by a warranty, either
express or implied. The author shall not be responsible for
any damages (including consequential) caused by reliance on
the materials presented, including but not limited to
typographical errors or arithmetic errors.
*/
#define MAINLY
#include "c80def.h"
#ifdef ASCII
#define NCHARS 128
#else
#define NCHARS 256
#endif
#ifdef CP_M
extern FILE *STDIN, *STDOUT;
static FILE *STDERR;
#endif
main (argc, argv)
int argc;
char **argv;
{
static char Version[]= "$W$ $D$";
char tr[NCHARS];
static char nc[]=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
register int c, nci;
for (c= NCHARS-1; c >= 0; c--)
tr[c]= EOS;
tr[NEWLINE]= NEWLINE;
tr[' ']= ' ';
nci= 0;
while ((c= getchar()) != EOF)
{
if (tr[c] == EOS)
tr[c]= nc[nci]? nc[nci++] : '?';
putchar(tr[c]);
}
} /* end main */